<template>
  <div class="all">
    <div class="all-1">
      <!-- 头部 -->
      <div class="all-title">
        <h2>全部</h2>
        <el-dropdown style="margin-left: 10px">
          <el-button type="primary" size="mini">
            选择分类<i class="el-icon-arrow-down el-icon--right"></i>
          </el-button>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>华语</el-dropdown-item>
            <el-dropdown-item>粤语</el-dropdown-item>
            <el-dropdown-item>日语</el-dropdown-item>
            <el-dropdown-item>韩语</el-dropdown-item>
            <el-dropdown-item>欧美</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
        <el-button type="danger" size="mini" style="margin-left:670px"
          >热门</el-button
        >
      </div>
      <!-- 中间内容 -->
      <div class="song-context">
        <div class="mkkk" v-for="item in songdanlist.playlists" :key="item.id">
          <div class="song-context-1">
            <div class="bottom">
              <span
                class="el-icon-headset"
                style="margin: 9px 5px 9px 10px"
              ></span>
              <span>952万</span>
              <span class="el-icon-video-play" style="margin-left: 60px"></span>
            </div>
            <a
              ><img
                :src="item.coverImgUrl"
                alt=""
                style="width:140px; height:140px;"
            /></a>
          </div>
          <a href="#"
            ><p style="margin:3px 0">{{ item.name }}</p></a
          >
          <span style="color:grey">by</span>
          <a href="#" class="zouzhe">{{ item.creator.nickname }}</a>
        </div>
      </div>
      <!-- 分页器 -->
      <div class="pagination">
        <el-pagination background layout="prev, pager, next" :total="1000">
        </el-pagination>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState, mapActions } from 'vuex'
export default {
  name: 'SongSheet',
  computed: {
    ...mapState({
      songdanlist: state => state.songsheet.songdanlist
    })
  },
  methods: {
    ...mapActions('songsheet', ['getSongDan'])
  },
  mounted() {
    this.getSongDan()
  }
}
</script>

<style>
.el-dropdown {
  vertical-align: top;
}
.el-dropdown + .el-dropdown {
  margin-left: 15px;
}
.el-icon-arrow-down {
  font-size: 12px;
}
.all {
  width: 980px;
  border: 1px solid rgb(194, 194, 194);
  margin: 0 auto;
  background: white;
}
.all-1 {
  padding: 40px;
}
.all-title h2 {
  font-size: 26px;
  font-weight: inherit;
}
.all-title {
  display: flex;
  width: 900px;
  height: 42px;
  line-height: 42px;
  border-bottom: 2px solid brown;
}
.song-context {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.song-context-1 {
  position: relative;
}
.song-context p {
  width: 140px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-context-1 .bottom {
  position: absolute;
  bottom: 5px;
  width: 140px;
  height: 27px;
  line-height: 27px;
  background-color: rgba(0, 0, 0, 0.2);
}
.mkkk {
  padding: 0 20px 30px 0;
}
.pagination {
  text-align: center;
}
html {
  background: rgb(245, 245, 245);
}
.mkkk .zouzhe {
  display: inline-block;
  width: 110px;
  margin-left: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
</style>
